import * as THREE from "three";

class Clazz {
    constructor(type) {
        this.physicalType = type;
        this.position = new THREE.Vector3();
        this.size = new THREE.Vector3();
    }

    update() {
    }

    getSize() {
    }


    createOutline() {
        let geometry = new THREE.BoxGeometry(1, 1, 1);
        let material = new THREE.MeshBasicMaterial({color: 0x00ff00, opacity: 0.5});
        let cube = new THREE.Mesh(geometry, material);
        this.outline = cube;
    }

    createPhyMode() {
        return physicalWorld.add({
            type: this.physicalType == null ? "box" : this.physicalType,
            size: [this.size.x, this.size.y, this.size.z],
            pos: [this.position.x, this.position.y, this.position.z],
            move: true,
            world: physicalWorld
        });
    }

    toArray(obj3D) {
        return [obj3D.x, obj3D.y, obj3D.z];
    }
}

export {Clazz}